class BasePoint extends AwareObj{
  boolean drawFlag;

  int getX(){
    return 0;
  };
  
  int getY(){
    return 0;
  }
  
  void setDrawFlag( boolean flag){
    drawFlag = flag;
  };
  
};

class BouncePoint extends BasePoint{
  
  int x;
  int y;
  int dx;
  int dy;
  int r;
  color c;
  
  BouncePoint(){
    x = int( random( width));
    y = int( random( height));
    dx = int( random( -30, 30));
    dy = int( random( -30, 30));    
    r = int( random( 3, 10));
    c = color( int(random( 256)), int(random( 256)), int(random( 256)));
    drawFlag = true;
  };

  void update(){
    x = x + dx;
    y = y + dy;
    if(( x < 0) || ( x > width)){
      dx = -dx;
    }
    if(( y < 0) || ( y > height)){
      dy = -dy;
    }
    if( drawFlag){
      noStroke();
      fill( c);
      ellipseMode( CENTER);
      ellipse( x, y, r, r);
    };
  };
  
  int getX(){
    return x;
  };
  
  int getY(){
    return y;
  }
  
  void debugOutput(){
  };
  
  boolean dead() {
    return false;
  }

};

class FlipPoint extends BasePoint{
  
  BasePoint p1;
  BasePoint p2;
  
  FlipPoint( BasePoint b1, BasePoint b2){
    p1 = b1;
    p2 = b2;
  }

  int getX(){
    return p1.getX() - ( p2.getX() - p1.getX());
  };
  
  int getY(){
    return p1.getY() - ( p2.getY() - p1.getY());
  }
  
}

